﻿#include "ssTransformSystem.h"
#include "../node/ssNode.h"
#include "../element/ssTransform.h"


namespace StarSeeker
{

	ssTransformSystem::ssTransformSystem()
	{
		m_compType.Insert(ssComponent::ComponentType_e::SS_COMPONENT_TRANSFORM);
	}

	void ssTransformSystem::Work()
	{
		ssTransform* ptf = 0;
		for (u32 i = 0; i < m_nodes.Count(); ++i)
		{
			ptf = SS_DYNAMIC_CAST(ssTransform*, m_nodes[i]->GetComponent(ssComponent::SS_COMPONENT_TRANSFORM));
			ptf->ComputeViewMatrix();
			ptf->UpdateChildren();
		}
	}

}
